home *** CD-ROM | disk | FTP | other *** search
/ Inside Multimedia 1994 April / Inside Multimedia CD-ROM (April 1994).iso / prg / gs / gssource.exe / CCFONT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-03  |  2.6 KB  |  61 lines

  1. /* Copyright (C) 1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* ccfont.h */
  21. /* Header for fonts compiled into C. */
  22.  
  23. /* Define type-specific refs for initializing arrays. */
  24. #define ref_(t) struct { struct tas_s tas; t value; }
  25. typedef struct { short len; const char _ds *str; } const_charray;
  26. typedef struct { byte encx, charx; } charindex;
  27. #define array_v(n,p,ea)\
  28.  { {(t_array<<r_type_shift)+(ea), n}, (const ref *)(p) }
  29. #define boolean_v(b) { {t_boolean<<r_type_shift}, (ushort)(b) }
  30. #define integer_v(i) { {t_integer<<r_type_shift}, (long)(i) }
  31. #define name_v(n,s)\
  32.  { {t_name<<r_type_shift, n}, s }
  33. #define null_v() { {t_null<<r_type_shift} }
  34. #define real_v(v) { {t_real<<r_type_shift}, (float)(v) }
  35. #define string_v(n,s)\
  36.  { {(t_string<<r_type_shift)+a_readonly, n}, s }
  37.  
  38. /* Support routines in iccfont.c */
  39. typedef struct {
  40.     const charindex _ds *enc_keys;    /* keys from encoding vectors */
  41.     uint num_enc_keys;
  42.     const char _ds * _ds *str_keys;    /* string keys */
  43.     uint num_str_keys;
  44.     uint extra_slots;        /* (need 1 extra for fonts) */
  45.     uint dict_attrs;        /* protection for dictionary */
  46.     uint value_attrs;        /* protection for values */
  47.                     /* (only used for string dicts) */
  48. } cfont_dict_keys;
  49. /* We pass a procedure vector to the font initialization routine */
  50. /* to avoid having externs, which compromise sharability. */
  51. typedef struct cfont_procs_s {
  52.     int (*ref_dict_create)(P3(ref *, const cfont_dict_keys _ds *,
  53.                   const ref _ds * _ds *));
  54.     int (*string_dict_create)(P3(ref *, const cfont_dict_keys _ds *,
  55.                      const const_charray _ds *));
  56.     int (*num_dict_create)(P3(ref *, const cfont_dict_keys _ds *,
  57.                   const float _ds *));
  58.     int (*name_array_create)(P3(ref *, const char _ds * _ds *, int));
  59.     int (*dict_put)(P3(ref *, const char _ds *, const ref *));
  60. } cfont_procs;
  61.